package week03.robotman;

import week03.robotman.pro.*;
import week03.robotman.pro.walk.*;

/**
 * Created by zhangxiaokun on 2018/2/8.
 */
public class WalkRobotmanBuilder implements RobotmanBuilder {
    private Robotman robotman;
    private Head head;
    private Body body;
    private Hand hand;
    private Leg leg;

    @Override
    public void buildHead() {
        head = new WalkHead();
    }

    @Override
    public void buildBody() {
        body = new WalkBody();
    }

    @Override
    public void buildHand() {
        hand = new WalkHand();
    }

    @Override
    public void buildLeg() {
        leg = new WalkLeg();
    }

    @Override
    public Robotman combineResult() {
        robotman = new WalkRobotman();
        robotman.setBody(body);
        robotman.setHead(head);
        robotman.setHand(hand);
        robotman.setLeg(leg);
        return robotman;
    }
}
